#pragma once
#include "Common.h"
#include "PageCache.h"

class CentralCache
{
public:
    static CentralCache* GetInstance(); 
    size_t FetchRangeObj(void*& start, void*& end, size_t batchNum, size_t size);
    void ReleaseListToSpan(void* start, size_t size);
private:
    CentralCache() = default;
    CentralCache(const CentralCache&) = delete;
    CentralCache& operator=(const CentralCache&) = delete;

    Span* GetOneSpan(SpanList& list, size_t size);

    SpanList _spanLists[list_num];

    static CentralCache _centralCache;
};


